<?php
include_once __DIR__ . '/../utils/Router.php';
$router = Router::getInstance();
$router->setControllerPath(ROOT . '/controller');
$router->addRoute('default', array(
    "pattern" => '/',
    "controller" => 'welcome.php'
));
$router->addRoute('imgfromprod', array(
    "pattern" => '/imgfromprod-{productid}',
    "controller" => 'product/ImageFromProduct.php',
    "validation" => array("productid" => "\d+")
));
$router->addRoute('productlist', array(
    "pattern" => '/productlist',
    "controller" => 'product/ProductListController.php'
));
$router->addRoute('cart', array(
    "pattern" => '/cart',
    "controller" => 'cart/CartController.php'
));
$router->addRoute('aboutUs', array(
    "pattern" => '/aboutUs',
    "controller" => 'AboutUsController.php'
));
$router->addRoute('inscription', array(
    "pattern" => '/inscription',
    "controller" => 'user/InscriptionController.php'
));
$router->addRoute('inscriptionpost', array(
    "pattern" => '/inscription',
    "method" => 'POST',
    "controller" => 'user/InscriptionPostController.php'
));
$router->addRoute('updateuserpost', array(
    "pattern" => '/updateuser',
    "method" => 'POST',
    "controller" => 'user/UserUpdatePostController.php'
));
$router->addRoute('updateuser', array(
    "pattern" => '/updateuser',
    "controller" => 'user/UserUpdateController.php'
));
$router->addRoute('connection', array(
    "pattern" => '/connection',
    "method" => 'POST',
    "controller" => 'user/ConnectionController.php'
));
$router->addRoute('disconnect', array(
    "pattern" => '/disconnect',
    "controller" => 'user/DisconnectController.php'
));
$router->addRoute('contactUs', array(
    "pattern" => '/contactUs',
    "controller" => 'contact/ContactUsController.php'
));
$router->addRoute('contactUsPost', array(
    "pattern" => '/contactUs',
    "method" => 'POST',
    "controller" => 'contact/ContactUsPostController.php'
));
$router->addRoute('sponsor', array(
    "pattern" => '/sponsor',
    "controller" => 'SponsorController.php'
));
$router->addRoute('productview', array(
    "pattern" => '/productview-{lastindex}',
    "controller" => 'product/ProductViewController.php',
    "validation" => array("lastindex" => "\d+")
));
$router->addRoute('manipulatecart', array(
    "pattern" => '/manipulatecart',
    "method" => 'POST',
    "controller" => 'cart/ManipulateCartController.php'
));
$router->addRoute('cartdetails', array(
    "pattern" => '/cartdetails',
    "controller" => 'cart/CartDetailsController.php'
));
$router->addRoute('buy', array(
    "pattern" => '/buy',
    "controller" => 'cart/BuyController.php'
));
$router->loadRoute();